<?php
namespace Admin\Controller;

use Base\Controller\AdminBaseController;

class MainController extends AdminBaseController {
	
    public function index(){
    	
    	$mysql= M()->query("select VERSION() as version");
    	$mysql=$mysql[0]['version'];
    	$mysql=empty($mysql)?L('UNKNOWN'):$mysql;
    	
    	// server infomations
    	$info = array (
			L('OPERATING_SYSTEM') => PHP_OS,
			L('OPERATING_ENVIRONMENT') => $_SERVER["SERVER_SOFTWARE"],
	        L('PHP_VERSION') => PHP_VERSION,
			L('PHP_RUN_MODE') => php_sapi_name(),
			L('PHP_VERSION') => phpversion(),
			L('MYSQL_VERSION') =>$mysql,
			L('PROGRAM_VERSION') => XCMS_VERSION . "&nbsp;&nbsp;&nbsp; [<a href='http://www.jnbqs.com' target='_blank'>JNBQS</a>]",
			L('UPLOAD_MAX_FILESIZE') => ini_get('upload_max_filesize'),
			L('MAX_EXECUTION_TIME') => ini_get('max_execution_time') . "s",
			L('DISK_FREE_SPACE') => round((@disk_free_space(".") / (1024 * 1024)), 2) . 'M',
    	);
    	$this->assign('server_info', $info);
    	
    	$this->display(':dashboard');
		return;
    }
}